<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:composite="http://java.sun.com/jsf/composite">

<composite:interface>

	<composite:attribute name="editavel" required="true"/>
	<composite:attribute name="valor" required="true" />
	<composite:attribute name="disabled" default="false"/>
	<composite:attribute name="valorItens" required="true" />
	<composite:attribute name="showEnumLabel"  default="false"/>
	<composite:attribute name="readonly" required="false" default="false" />
	<composite:attribute name="converter" required="false" default="false" />
	<composite:attribute name="obrigatorio" default="true"/>
	<composite:attribute name="label" required="true"/>
	<composite:clientBehavior name="clickEvent" event="click" targets="#{cc.id}_select_One_Radio"/>

</composite:interface>

<composite:implementation>
	
		<h:outputText id="#{cc.id}_Label_Select_One_Radio" value="#{cc.attrs.valor.descricao}" rendered="#{not cc.attrs.editavel}"  style="font-weight:normal;"/>

		<p:selectOneRadio id="#{cc.id}_select_One_Radio" value="#{cc.attrs.valor}" rendered="#{cc.attrs.editavel}"
			              required="#{cc.attrs.obrigatorio}" label="#{cc.attrs.label}" readonly="#{cc.attrs.readonly}" disabled="#{cc.attrs.disabled}">
			
			<c:if test="#{cc.attrs.converter}">
				<f:converter converterId="#{cc.attrs.converter}" />			
			</c:if>
			
			<f:selectItems value="#{cc.attrs.valorItens}" var="radio" itemValue="#{radio}" itemLabel="#{radio.descricao}"/>
		</p:selectOneRadio>
		
</composite:implementation>
</html>